package com.lenovo.smarttraffic.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.view.View;
import android.widget.ImageView;
import android.widget.TextView;

import com.lenovo.smarttraffic.R;

import java.util.ArrayList;

public class Activity_4_2 extends AppCompatActivity {
    private ImageView icon;
    private TextView title;
    private TextView a_4_2_tv1;
    private TextView a_4_2_tv2;
    private TextView a_4_2_tv3;
    private TextView a_4_2_tv4;
    ArrayList arrayList = new ArrayList();

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.a_4_2);
        initView();

        arrayList = getIntent().getStringArrayListExtra("data");

        a_4_2_tv1.setText(arrayList.get(1)+"-"+arrayList.get(2));

        a_4_2_tv2.setText("票价：￥"+arrayList.get(3)+".0");

        a_4_2_tv3.setText("里程：￥"+arrayList.get(4)+"KM");

    }

    private void initView() {
        icon = (ImageView) findViewById(R.id.icon);
        title = (TextView) findViewById(R.id.title);
        a_4_2_tv1 = (TextView) findViewById(R.id.a_4_2_tv1);
        a_4_2_tv2 = (TextView) findViewById(R.id.a_4_2_tv2);
        a_4_2_tv3 = (TextView) findViewById(R.id.a_4_2_tv3);
        a_4_2_tv4 = (TextView) findViewById(R.id.a_4_2_tv4);
        icon.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                finish();
            }
        });
        title.setText("定制班车");
        a_4_2_tv4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                startActivity(new Intent(Activity_4_2.this,Activity_4_3.class).putStringArrayListExtra("data",arrayList));
            }
        });
    }
}
